Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize interface source code and documentation #2338

Merged
merged 25 commits into from
Mar 22, 2022

Conversation

josh146
Copy link
Member

@josh146 josh146 commented Mar 16, 2022

Context: This is a follow up to PR #2337. The final step is to better organize the source code location of the qml.execute function, and ensure everything shows up in the documentation.

Description of the Change:

  • The execute and cache_execute functions have been moved to pennylane/interfaces/execution.py.
  • The set_shots context manager has been moved to pennylane/interfaces/set_shots.py
  • The pennylane/interfaces/__init__.py file has been updated to ensure that all internal functions and interfaces are properly documented.

Benefits:

  • Better organization of the source code, easier to find the location of the execute functions
  • Better organization of the documentation.

Possible Drawbacks:

  • set_shots doesn't really belong along the interface code, but I wasn't sure where else to put it for now.

Related GitHub Issues: n/a

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@josh146 josh146 requested a review from albi3ro March 16, 2022 07:54
@josh146 josh146 added the review-ready 👌 PRs which are ready for review by someone from the core team. label Mar 16, 2022
@codecov
Copy link

codecov bot commented Mar 16, 2022

Codecov Report

Merging #2338 (7e5809e) into master (660e9fc) will increase coverage by 2.38%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #2338      +/-   ##
==========================================
+ Coverage   97.03%   99.42%   +2.38%     
==========================================
  Files         241      243       +2     
  Lines       18342    18347       +5     
==========================================
+ Hits        17799    18241     +442     
+ Misses        543      106     -437     
Impacted Files Coverage Δ
pennylane/interfaces/torch.py 100.00% <ø> (+3.27%) ⬆️
pennylane/tape/tape.py 98.73% <ø> (ø)
pennylane/interfaces/__init__.py 100.00% <100.00%> (+6.34%) ⬆️
pennylane/interfaces/execution.py 100.00% <100.00%> (ø)
pennylane/interfaces/set_shots.py 100.00% <100.00%> (ø)
pennylane/_qubit_device.py 98.76% <0.00%> (+0.30%) ⬆️
pennylane/interfaces/tensorflow_autograph.py 100.00% <0.00%> (+1.17%) ⬆️
pennylane/interfaces/tensorflow.py 100.00% <0.00%> (+2.04%) ⬆️
pennylane/devices/default_qubit_tf.py 90.16% <0.00%> (+3.27%) ⬆️
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 660e9fc...7e5809e. Read the comment docs.

Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly what I wanted! Guess I should have reviewed these in a different order...

Base automatically changed from move-interfaces to master March 22, 2022 03:12
@josh146 josh146 merged commit 30eff2f into master Mar 22, 2022
@josh146 josh146 deleted the reorganize-interfaces branch March 22, 2022 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants